package mzt;

import java.io.BufferedInputStream;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

import org.apache.commons.io.FileUtils;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.Connection.Response;

public class Demoreset {

	public static void main(String[] args) throws Exception {
		 String src = "http://i.meizitu.net/2018/08/12c01.jpg";
//		String src = "http://mm.chinasareview.com/wp-content/uploads/2017a/07/03/03.jpg";
		URL url = new URL(src);
		String referer = url.getProtocol() + "://" + url.getHost();

		Connection ref = Jsoup.connect(url.toString()).ignoreContentType(true).referrer(referer);
		Response execute = ref.execute();
		BufferedInputStream bodyStream = execute.bodyStream();
		FileUtils.copyInputStreamToFile(bodyStream, new File("c://11.jpg"));
	}

}
